fix(steer): keep a quick follow-up message from vanishing#3013
Merged
Conversation
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
Contributor
|
Reviews (1): Last reviewed commit: "keep steer echo from clearing pending me..." | Re-trigger Greptile |
There was a problem hiding this comment.
Targeted, well-commented bug fix that adds an extra guard to prevent steer message echoes from replacing unrelated optimistic placeholders. Uses an existing, well-tested isSteerMessage method and adds clear coverage for both paths. The resolved bot comment is a style suggestion only.
New commits pushed (delta classified non_trivial_delta) — stamphog approval dismissed; re-review running automatically.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Reported by a user using Steer. With a task in Queue mode, sending one message then switching to Steer steers that message correctly. But a second message sent in the brief window right after the switch is lost: it renders for a moment, then disappears from the chat once the first message is brought into context.
Changes
Root cause: every
session/promptecho was routed throughreplaceOptimisticWithEvent, which clears all of a session's optimistic placeholders. A steer carries no optimistic placeholder of its own (sendSteerPromptskipsapplyOptimisticPrompt), so when the first message's steer echo arrived it wiped the second message's still-pending placeholder, making it vanish until its own echo landed.Now a steer echo is appended instead of replacing, so it renders without disturbing other in-flight placeholders. Normal prompt echoes still replace their placeholder as before.
How did you test this?
steer echo routingtests insessionServiceHost.test.ts: a steer echo appends without clearing pending optimistic placeholders, and a normal prompt echo still replaces its own placeholder. Confirmed the new steer test fails against the pre-fix code.@posthog/uiunit suite (1039 tests)@posthog/coreunit suite (1788 tests)pnpm typecheck(all packages)Automatic notifications